package com.pubinfo.passbook.engine.process.variable.medicine.payinformation;

import com.pubinfo.passbook.common.model.ruler.PayInformation;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * 自理金额
 *
 * @author zhouch
 * @date 2022/3/14 9:03
 */
@Slf4j
public class CareProcessor extends PayinformationVariableProcessor {

    @Override
    public BigDecimal get(PayInformation data) {
        //自理金额
        BigDecimal selfpaymentCare = data.getSelfpaymentCare();
        if (selfpaymentCare.equals(new BigDecimal(-0.0000999))) {
            cache.markNeedAudit();
            log.info("{} ==> 需要人工审核.", getClass().getName());
            selfpaymentCare = BigDecimal.ZERO;
        }

        return selfpaymentCare;
    }

}
